<template>
	<view>
		<tn-fab :btnList="btnList" :left="left" :right="right" :bottom="bottom" :width="width" :height="height"
			:iconSize="iconSize" :backgroundColor="backgroundColor" :fontColor="fontColor" :icon="icon"
			:animationType="animationType" :showMask="showMask" @click="clickFabItem">
		</tn-fab>
	</view>
</template>

<script>
	export default {
		name: "musicFab",
		data() {
			return {
				left: 'auto',
				right: 20,
				bottom: 140,
				width: 88,
				height: 88,
				iconSize: 40,
				icon: 'sing',
				backgroundColor: '#01BEFF',
				fontColor: '#FFFFFF',
				animationType: 'up',
				showMask: false,
				btnList: [{
						icon: 'video',
						text: '播放音乐',
						textColor:'#000000',
						bgColor: '#E72F8C'
					},
					{
						icon: 'stop',
						text: '暂停音乐',
						textColor:'#000000',
						bgColor: '#FF7043'
					}
				],
			}
		},
		methods: {
			// 点击悬浮按钮的内容
			clickFabItem(e) {
				if (e.index == 0) {
					getApp().globalData.audio.play();
				} else {
					getApp().globalData.audio.pause();
				}
			}
		}
	}
</script>

<style>

</style>
